var express = require('express'),
	crypto = require('../db/crypto'),
	logModule = require('../module/logModule'),
	log = express();

log.get('/log',function(req,res){
	res.render('log',{});
});

log.post('/log',function(req,res){
	// console.log(req.body.logName);
	logModule.selectPassword(req.body.logName,function(err,data){
		if (err) {
			console.log(err);
		} else {
			// console.log(data);

			res.json(logModule.checkPassword(req.body.logPassword,data[0].password));
		}
		
	});
});



module.exports = log;